Technical Field
The present invention relates to processing for recognizing a character by image processing. The present invention particularly relates to a method of individually detecting a character string of each line of text from a gray-scale image of character strings arranged in a plurality of lines of text, and to a character recognition apparatus employing this method.
Related Art
In character recognition processing, generally, characters are individually cut out from a gray-scale image generated by capturing an image of a character string. Then, matching processing (model matching) using various character models is performed on each character, and thus the content of the character string is recognized.
To individually extract a character from an image of a character string, processing for projecting an image onto an axis, of two axes representing coordinates in an image, orthogonal to the longitudinal direction of the character string (direction in which the characters are arranged). Then, a range corresponding to a character string of each line of text is detected for each line of text from a projected pattern thus generated (this detection processing is hereinafter referred to as “processing for separating lines of text”). Furthermore, the processing for projecting an image onto the axis along the character string is performed for each extracted range. An area corresponding to each character (hereinafter referred to as “character area”) is detected for each character from the projected pattern thus generated (see, for example, Patent Literatures 1 and 2).
Specifically, when a document in horizontal writing is read, with the axis in the lateral direction of the image defined as an x axis and the axis in the vertical direction of the image defined as a y axis, first, the processing for separating the lines of text is performed by the projection processing onto the y direction, and then the projection processing onto the x direction is performed for each line of text thus separated, to detect each character area. When the document in vertical writing is read, first, the processing for separating the lines of text by the projection processing onto the x direction is performed, and then the projection processing onto the y direction is performed for each separated line of text, to detect each character area.
In a case where the accumulated value of the gray level data is projected in each projection processing, a trough portion of the projected pattern is detected as the range corresponding to the character when the character portion is darker than the background, and a peak portion of the projected pattern is detected as the range corresponding to the character when the character portion is brighter than the background. In a case where an image is converted into binary, with the gray-level lower than a threshold set to “1” and the accumulated value of the binary data is projected, a peak portion of the projected pattern is detected as the range corresponding to the character when the character portion is darker than the background, and a trough portion of the projected pattern is detected as the range corresponding to the character when the character portion is brighter than the background.
PTL 1: Japanese Unexamined Patent Application Publication No. 1998-69524
PTL 2: Japanese Unexamined Patent Application Publication No. 2000-357287